package com.example.layouttest01;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {
    private TextView mTextRelative;
    private TextView mTextTable;
    private TextView mTextGrid;
    private TextView mTextConstraint;
    private TextView mTextLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        mTextRelative=findViewById(R.id.text_relative);
        mTextRelative.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, RelativeActivity.class);
                startActivity(intent);
            }
        });
        mTextTable=findViewById(R.id.text_table);
        mTextTable.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, TableActivity.class);
                startActivity(intent);
            }
        });
        mTextGrid=findViewById(R.id.text_grid);
        mTextGrid.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this, GridActivity.class);
                startActivity(intent);
            }
        });
        mTextConstraint=findViewById(R.id.text_constraint);
        mTextConstraint.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this,ConstraintActivity.class);
                startActivity(intent);
            }
        });
        mTextLayout=findViewById(R.id.text_layout);
        mTextLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this,LayoutActivity.class);
                startActivity(intent);
            }
        });
        mTextLayout=findViewById(R.id.text_layout);
        mTextLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(MainActivity.this,LayoutActivity.class);
                startActivity(intent);
            }
        });
    }
}